home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / infoserv / www / cern / doc / www-talk.archive.Z / www-talk.archive / text0191.txt < prev    next >
Encoding:
Text File  |  1992-11-30  |  1.4 KB  |  59 lines

  1. I don't know how many of you are using Mime for your mail (other
  2. than Dan) but I am starting to.  So today I modified my mailcap
  3. to be handle text/x-html messages, and since there was a little
  4. difficulty I thought I share it with you.
  5.  
  6. Here is what I added to my mailcap
  7.  
  8. text/x-html; mime-show-html -f %s; needsterminal
  9.  
  10. The command mime-show-html is a new script I wrote.  It starts
  11. up the Viola WWW browser (for which I thank the author!) but
  12. there are some small problems with Viola
  13.  
  14. 1) It seems that it requires that the file have suffix html
  15. in order to work
  16. 2) You can't tell it what file to read from the command line,
  17. rather you must set an environment variable.
  18.  
  19. So I wrote this little script:
  20.  
  21. #!/bin/csh
  22. # Run the Viola WWW X windows hypertext system for a Mime message
  23. # I expect caller (metamail) to supply the file to read with -f,
  24. # and it will be a /tmp file
  25.  
  26. # Process args 
  27. while ($#argv > 0 && "$1" =~ -*)
  28.   switch ($1)
  29.   case -f:
  30.     shift
  31.     if ($#argv < 1) goto usage
  32.     set TEMP = $1.html
  33.     cp $1 $TEMP
  34.     setenv WWW_HOME $TEMP
  35.     shift
  36.     breaksw
  37.   default:
  38.     goto usage
  39.     breaksw
  40.  endsw
  41. end
  42.  
  43. set VIOLA=/usr/local/WWW/Viola
  44. setenv VIOLA_PATH $VIOLA/apps
  45. $VIOLA/bin/viola 
  46. rm $TEMP
  47. exit 0
  48.  
  49. usage:
  50.  echo "usage: `basename $0` [-f HTML-FILE]"
  51.  exit 1
  52.  
  53. If you wish to use this script you will need to change the
  54. setting of VIOLA depending on where you installed it.
  55.  
  56. Best wishes, and now we can use Mime to send WWW to each
  57. other more easily.  
  58.  
  59.